package com.wf.course.service.impl;

import com.utils.page.PageBean;
import com.wf.course.dao.IGroupBuyingMapper;
import com.wf.course.model.comm.GroupBuying;
import com.wf.course.service.IGroupBuyingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class IGroupBuyingServiceImpl implements IGroupBuyingService {

    @Autowired
    private IGroupBuyingMapper groupBuyingMapper;

    @Override
    public void activityList(PageBean<GroupBuying> pageBean) {
        pageBean.setResults(groupBuyingMapper.activityList(pageBean));
        pageBean.setTotalCount(groupBuyingMapper.activityCount(pageBean));
    }

    @Override
    public void activityMemberList(PageBean<GroupBuying> pageBean) {
        pageBean.setResults(groupBuyingMapper.activityMemberList(pageBean));
        pageBean.setTotalCount(groupBuyingMapper.activityMemberCount(pageBean));
    }

    @Override
    public Integer addActivity(GroupBuying groupBuying) {
        return groupBuyingMapper.addActivity(groupBuying);
    }

    @Override
    public Integer updateActivity(GroupBuying groupBuying) {
        return groupBuyingMapper.updateActivity(groupBuying);
    }

    @Override
    public GroupBuying searchActivity(Integer id) {
        return groupBuyingMapper.searchActivity(id);
    }

    @Override
    public Integer deleteActivity(Integer id) {
        return groupBuyingMapper.deleteActivity(id);
    }
}
